package com.ruoyi.sqldow.service.impl;

import com.ruoyi.sqldow.mapper.EnergyChartsMapper;
import com.ruoyi.sqldow.service.EnergyChartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 查询能源数据，作出折线图
 */
@Service
public class EnergyChartsServiceImpl implements EnergyChartsService {
    @Autowired
    EnergyChartsMapper energyChartsMapper;
    @Override
    public List<List<Map<Object,Object>>> selectenergy(String year) {
        List<List<Map<Object, Object>>> energy=new ArrayList<>();
        energy.add(energyChartsMapper.selectElectricity(year));
        energy.add(energyChartsMapper.selectNaturalgas(year));
        energy.add(energyChartsMapper.selectCoal(year));
        energy.add(energyChartsMapper.selectWater(year));

        return energy;


    }
}
